package cn.tedu.kcircle.comment.front.adapter.converter;

import cn.tedu.kcircle.comment.front.api.rpc.po.CommentListItemPO;
import cn.tedu.kcircle.comment.front.service.bo.CommentListItemBO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CommentConverter {
    public CommentListItemPO bo2PO(CommentListItemBO commentListItemBO){
        CommentListItemPO commentListItemPO = new CommentListItemPO();
        BeanUtils.copyProperties(commentListItemBO,commentListItemPO);
        return commentListItemPO;
    }

    public List<CommentListItemPO> bo2POList(List<CommentListItemBO> commentListItemBOList){
        return commentListItemBOList.stream().map(this::bo2PO).toList();
    }

}
